package com.eu.ebpm.engine.entity.args;

import com.eu.ebpm.engine.query.TaskQuery;

public class QueryParam extends Param {
	
	public static final String PAGE_NUM = "pageNum";
	
	public static final String PAGE_SIZE = "pageSize";
	
	public static final String ORDER_BY_SQL = "order_by_sql";
	
	public boolean isPage() {
		return args.containsKey(PAGE_NUM) && args.containsKey(PAGE_SIZE);
	}
	
	public boolean isIdentity() {
		return args.containsKey(TaskQuery.TASK_ORG) || args.containsKey(TaskQuery.TASK_ROLER) || args.containsKey(TaskQuery.TASK_USER);
	}
	
	public void setPageNum(Integer pageNum) {
		args.put(PAGE_NUM, pageNum);
	}
	
	public void setPageSize(Integer pageSize) {
		args.put(PAGE_SIZE, pageSize);
	}
	
	public Integer getPageNum() {
		return (Integer) args.get(PAGE_NUM);
	}
	
	public Integer getPageSize() {
		return (Integer) args.get(PAGE_SIZE);
	}
	
	public void setOrderBy(String orderBy) {
		args.put(ORDER_BY_SQL, orderBy);
	}

}
